cmake_minimum_required(VERSION 2.8)
project(TEST)

add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/func1.cpp
    COMMAND C:/Python27/python.exe func1.py > ${CMAKE_CURRENT_BINARY_DIR}/func1.cpp
    WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
    COMMENT "show a message"
    DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/func1.py
)

add_executable(main main.cpp ${CMAKE_CURRENT_BINARY_DIR}/func1.cpp)
